﻿namespace ChinaUnicom.Schedule
{
    using System;
    using System.Collections.Generic;
    using System.Threading;

    public class ParallelQuene : IScheduleQuene
    {
        Dictionary<ITask, Timer> timers;

        public ParallelQuene()
        {
            timers = new Dictionary<ITask, Timer>();
        }

        public void Schedule(ITask task)
        {
            Timer timer = new Timer(OnTimerCallback, null, Timeout.Infinite, Timeout.Infinite);
            timers.Add(task, timer);
        }

        void OnTimerCallback(object state)
        {
            throw new NotImplementedException();
        }

        void OnTasksCompleted(object sender, EventHandler e)
        {
            ITask task = sender as ITask;

            throw new NotImplementedException();
        }

        public void Dispose()
        {
            throw new NotImplementedException();
        }


        public Status Status { get; private set; }
        
        public event EventHandler<ScheduleExceptionArgs> Error;

        public event EventHandler<StatusChangedArgs> StatusChanged;
    }
}
